From b4d5ca66e9a6f422f729215c5dbcfce4ecbab7cc Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 7 Oct 2025 14:08:11 +0200 Subject: [PATCH] luci-mod-network: show stop button if interface start is pending Currently, it is not possible to stop an interface from establishing a connection when it is flageed as pending in the netifd. This situation occurs when netifd tells a proto to establish a connection, but the proto is executing a blocken binary. This situation occurs in the proto 'modemmanager' when it wants to register but cannot. The timeout is set to '120' seconds. During this time, the establishment cannot be stopped via LuCI because the disable button can not be clicked. To fix this, the pending flag is also evaluated and the disable button is displayed in this state as well. Signed-off-by: Florian Eckert --- .../resources/view/network/interfaces.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index 3574115d3c..fcf59e54d1 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -269,7 +269,8 @@ return view.extend({ stat = document.querySelector('[id="%s-ifc-status"]'.format(ifc.getName())), resolveZone = render_ifacebox_status(box, ifc), disabled = ifc ? !ifc.isUp() : true, - dynamic = ifc ? ifc.isDynamic() : false; + dynamic = ifc ? ifc.isDynamic() : false, + pending = ifc ? ifc.isPending() : false; if (dsc.hasAttribute('reconnect')) { dom.content(dsc, E('em', _('Interface is starting...'))); @@ -317,6 +318,10 @@ return view.extend({ btn1.disabled = true; btn2.disabled = true; } + else if (pending === true) { + btn1.disabled = true; + btn2.disabled = false; + } else if (disabled === true) { btn1.disabled = false; btn2.disabled = true; @@ -500,7 +505,8 @@ return view.extend({ var tdEl = this.super('renderRowActions', [ section_id, _('Edit') ]), net = this.networks.filter(function(n) { return n.getName() == section_id })[0], disabled = net ? !net.isUp() : true, - dynamic = net ? net.isDynamic() : false; + dynamic = net ? net.isDynamic() : false, + pending = net ? net.isPending() : false; dom.content(tdEl.lastChild, [ E('button', { @@ -529,6 +535,12 @@ return view.extend({ tdEl.lastChild.childNodes[2].disabled = true; tdEl.lastChild.childNodes[3].disabled = true; } + else if(pending === true) { + tdEl.lastChild.childNodes[0].disabled = true; + tdEl.lastChild.childNodes[1].disabled = false; + tdEl.lastChild.childNodes[2].disabled = false; + tdEl.lastChild.childNodes[3].disabled = false; + } else if (disabled === true){ tdEl.lastChild.childNodes[0].disabled = false; tdEl.lastChild.childNodes[1].disabled = true; -- 2.30.2